import axios from 'axios'
const service = axios.create({
  baseURL: 'https://www.innisfree.cn',
  timeout: 5000
})
service.interceptors.request.use(config => {
  return config
})
service.interceptors.response.use(config => {
  if (config.status >= 200 && config.status < 300) {
    if (config.data.code === 1000) {
      return config.data
    }
    return Promise.reject(config.data)
  }
  return Promise.reject(config)
})
export default service
